//
//  RBVideoViewController.m
//  Budejie
//
//  Created by 华杨科技 on 2017/10/15.
//  Copyright © 2017年 饶波. All rights reserved.
//

#import "RBVideoViewController.h"
#import "RBRefreshHeader.h"

@interface RBVideoViewController ()

@end

@implementation RBVideoViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    RBNSLogFunction;

    // 设置内边距,解决tableView被遮盖问题
    self.tableView.contentInset = UIEdgeInsetsMake(64+35, 0, 49, 0);
    // 设置滚动条内边距
    self.tableView.scrollIndicatorInsets = self.tableView.contentInset;
    
    [self setupRefresh];
}

- (void)setupRefresh
{
    MJRefreshNormalHeader *refresh = [RBRefreshHeader headerWithRefreshingBlock:^{
        RBNSLogFunction;
    }];
    self.tableView.mj_header = refresh;
    [self.tableView.mj_header beginRefreshing];
}

#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 15;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *cellID = @"all";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellID];
    }
    cell.backgroundColor = RBRandomColor;

    cell.textLabel.text = [NSString stringWithFormat:@"%@--%ld",[self class],indexPath.row];
    return cell;
}
@end
